package com.log4j2;
/**
 * 邢帅教育
 * <p>
 * 本源代码由数据中心及其作者共同所有，未经版权持有者的事先书面授权，
 * 不得使用、复制、修改、合并、发布、分发和/或销售本源代码的副本。
 *
 * @copyright Copyright (c) 2018. xsteach.com all rights reserved.
 */

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @author maikec
 * @date 2018/9/28
 */
public class Log4j2HelloWorldExample {
    private static final Logger LOGGER = LogManager.getLogger("com.log4j2");

    public static void main(String[] args)
    {
        LOGGER.debug("Debug Message Logged !!!");
        LOGGER.info("Info Message Logged !!!");
        LOGGER.error("Error Message Logged !!!", new NullPointerException("NullError"));
        try {
            int  i = 1/0;
        } catch (ArithmeticException e) {
            LOGGER.error( "算法异常", e );
        }
    }
}
